using System;

namespace Core.Demo6_IrritatingParameter
{
	public class LibraryMgntService
	{
		private readonly SipConnection _sipConnection;

		public LibraryMgntService(SipConnection sipConnection)
		{
			_sipConnection = sipConnection;
		}

		public void SendReminderEmailToDefaulters()
		{
//			var books = _sipConnection.GetOverDueBook();
//			foreach (var book in books)
//			{
//				Console.WriteLine("Book {0} overdue");
//			}
		}
	}


	public class SipConnection
	{
		public SipConnection()
		{
			throw new ApplicationException("Bad Boy.. I am going to open remote session Sip protocol");
		}

		public void Issue(Book book) {}
		public void Return(Book book) {}
		public Book[] GetOverDueBook()
		{
			return new [] {new Book(), new Book(), };
		}
	}

	public class Book
	{
	}



	//Extract interface Refactoring
}